//
//  XDPerson1TableViewCell.m
//  Le way walkers
//
//  Created by dlios on 15-5-27.
//  Copyright (c) 2015年 LTXZ. All rights reserved.
//

#import "XDPerson1TableViewCell.h"

@interface XDPerson1TableViewCell()
@property (nonatomic,retain) UIImageView *image1;
@property (nonatomic, retain) UILabel *label;
@property (nonatomic, retain) UIImageView *back;

@end

@implementation XDPerson1TableViewCell

- (void)dealloc
{
    [_image1 release];
    [_label release];
    [_back release];
    [super dealloc];
}


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.image1 = [[UIImageView alloc]init];
        [self.contentView addSubview:_image1];
        
        
        self.label = [[[UILabel alloc]init]autorelease];
        self.label.textColor = [UIColor colorWithRed:0 / 255.0 green:62 / 255.0 blue:101 / 255.0 alpha:1];
        //[self.label setBackgroundColor:[UIColor blackColor]];
//        self.label.textColor = [UIColor blueColor];
        [self.contentView addSubview:self.label];
        
        self.back = [[UIImageView alloc] init];
        [self.contentView addSubview:self.back];
        
           }
    return self;
}




- (void)layoutSubviews
{
    [super layoutSubviews];
    _image1.frame = CGRectMake(16, 8, 35, 35);
//    self.image1.layer.cornerRadius = 17.5;
    self.image1.layer.masksToBounds = YES;
    
    self.label.frame = CGRectMake(70, 5, 100, 40);
    
    self.back.frame = CGRectMake(self.contentView.frame.size.width - 40, 9, 30, 30);
}

- (void)setXdper:(XDPerson *)xdper
{
    if (xdper != _xdper) {
        [_xdper release];
        _xdper = [xdper retain];
    }
    
    self.label.text = xdper.text;
    //NSLog(@"%@", self.image1);
    
    self.image1.image = [UIImage imageNamed:xdper.lala];
   // NSLog(@"%@", self.image1.image);
    
    self.back.image = [UIImage imageNamed:xdper.papa];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
